package com.otomotion.research.ants.information;

import com.otomotion.research.ants.entities.Entity;

import java.util.HashMap;
import java.util.ArrayList;

/**
 * Created by IntelliJ IDEA.
 * User: Mark the intern
 * Date: 6-Aug-2007
 * Time: 5:06:41 PM
 */
public class Surroundings extends HashMap<EntityType,EntityCollection> {

    Surroundings() {
        super();
    }

    public ArrayList<Entity> getItemsAtLocation(Coordinate coordinate) {
        ArrayList<Entity> entities = new ArrayList<Entity>();
        for(EntityCollection collection:this.values()) {
            if(collection.containsKey(coordinate)) {
                entities.add(collection.get(coordinate));
            }
        }
        return entities;
    }
}
